<?php
class Zenddn_Plugin_Permission extends Zend_Controller_Plugin_Abstract{
    
    public function preDispatch(Zend_Controller_Request_Abstract $request){
        $auth = Zend_Auth::getInstance();
        
        $module = $request->getModuleName();
        
        if($module == 'admin'){
            $flag = null;
            
            if(!$auth->hasIdentity() || $auth->getIdentity()->role == false){
                $request->setControllerName('auth');
                $request->setActionName('login');
            }
        }
    }
}